package hbtt.contrnller;

import hbtt.entity.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Poje {
   /* @RequestMapping("/add")
    public String get(){
        return "add";
    }
    @RequestMapping("/addUser")
    @ResponseBody
    public String poje(User user){
        System.out.println(user);
        return "user"+user;
    }*/

   /*List*/
   /*@RequestMapping("ListType")
   @ResponseBody
   public String userList(UserList userList){
       StringBuffer stringBuffer = new StringBuffer();
       for (User user:userList.getUsers()){
           stringBuffer.append(user);
       }
       return "用户："+stringBuffer.toString();
   }*/

   /*Set*/
   /*@RequestMapping("SetType")
   @ResponseBody
   public String userSet(UserSet userSet){
       StringBuffer stringBuffer = new StringBuffer();
       for (User user:userSet.getUsers()){
           stringBuffer.append(user);
       }
       return "用户："+stringBuffer.toString();
   }*/

    @RequestMapping("mapType")
    @ResponseBody
    public String userSet(UserMap userMap){
        StringBuffer stringBuffer = new StringBuffer();
        for (String key:userMap.getUsers().keySet()){
            User user=userMap.getUsers().get(key);
            stringBuffer.append(user);
        }
        return "用户："+stringBuffer.toString();
    }
}
